﻿@using Microsoft.AspNetCore.Http
@inject IHttpContextAccessor HttpContextAccessor

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"] - BulkyWeb</title>
    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />

    <link rel="stylesheet" href="~/BulkyWeb.styles.css" asp-append-version="true" />
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" />
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css" />
    <link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
    <link rel="stylesheet" href="//cdn.datatables.net/1.13.3/css/jquery.dataTables.min.css" />
    @* <link rel="stylesheet" href="~/css/jquery.dataTables.min.css"/> *@
</head>
<body>
    <header>
        <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-dark bg-primary border-bottom box-shadow mb-3">
            <div class="container-fluid">
                <a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">
                    <img src="~/images/book.png" style="width:30px;"/>
                </a>
                <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
                        aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
                    <ul class="navbar-nav me-auto">
                        <li class="nav-item">
                            <a class="nav-link " asp-area="Customer" asp-controller="Home" asp-action="Index">Home</a>
                        </li>

                        <li class="nav-item">
                            <a class="nav-link" asp-area="Admin" asp-controller="Order" asp-action="Index">Manage Order</a>
                        </li>
                        @if (User.IsInRole(SD.Role_Admin))
                        {
                            <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                                    Content Managment
                                </a>
                                <ul class="dropdown-menu">

                                    <li class="nav-item">
                                        <a class="dropdown-item" asp-area="Admin" asp-controller="Category" asp-action="Index">Category</a>
                                    </li>

                                    <li class="nav-item">
                                        <a class="dropdown-item" asp-area="Admin" asp-controller="Product" asp-action="Index">Product</a>
                                    </li>

                                    <li class="nav-item">
                                        <a class="dropdown-item" asp-area="Admin" asp-controller="Company" asp-action="Index">Company</a>
                                    </li>

                                    <li><hr class="dropdown-divider"></li>

                                    <li class="nav-item">
                                        <a class="dropdown-item" asp-area="Identity" asp-page="/Account/Register">Create User</a>
                                    </li>

                                    <li class="nav-item">
                                        <a class="dropdown-item" asp-area="User" asp-controller="User" asp-action="Index">Manage User</a>
                                    </li>
                                  
                                </ul>
                            </li>
                        }


                        <li class="nav-item">
                            <a class="nav-link" asp-area="Customer" asp-controller="Cart" asp-action="Index">
                                @await Component.InvokeAsync("ShoppingCart")
                            </a>
                        </li>



                    </ul>

                    <partial name="_LoginPartial" />

                </div>
            </div>
        </nav>
    </header>
    <div class="container">
        <main role="main" class="pb-3">
            <partial name="_Notification" />
            @RenderBody()
        </main>
    </div>

    <footer class="border-top footer bg-primary text-muted">
        <div class="container">
            Made with <i class="bi bi-heart-fill"></i> by DotNetMastery
        </div>
    </footer>
    <script src="~/lib/jquery/dist/jquery.min.js"></script>
    <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
    <script src="~/js/site.js" asp-append-version="true"></script>
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    <script src="//cdn.datatables.net/1.13.3/js/jquery.dataTables.min.js" asp-append-version="true"></script>
    @*  <script src="~/js/jquery.dataTables.min.js" asp-append-version="true"></script> *@
    
    <script src="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>

    <script src="https://cdn.tiny.cloud/1/g28lhnxtlihu4l4a381gw7tz47voznshwbi10lmsvlekrfme/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>
    @await RenderSectionAsync("Scripts", required: false)
</body>
</html>
